package lerr

import (
	"github.com/gogf/gf/v2/errors/gcode"
	"github.com/gogf/gf/v2/errors/gerror"
)

const (
	CodeFail     = 20500
	CodeAuthFail = 20405
)

type Lerr struct {
	Code int
	Msg  string
}

func Fail(err2 Lerr) error {
	code := err2.Code
	if code == 0 {
		code = CodeFail
	}
	return gerror.NewCode(gcode.New(code, err2.Msg, nil))
}
